import L from 'leaflet'
import 'leaflet/dist/leaflet.css'
import "leaflet.pm";
import "leaflet.pm/dist/leaflet.pm.css";
export function featureLayer(markerIcon) {
    // let featureGroup = L.featureGroup()
    // // 设置标记点：[纬度, 经度]-------------------------------------
    // const marker = L.marker([30.745922638363268, 104.00415658374735])
    // featureGroup.addLayer(marker)
    var kyiv = [50.5, 30.5],
        lnd = [51.51, -0.12],
        sf = [37.77, -122.42],
        dc = [38.91, -77.04],
        trd = [63.41, 10.41],
        mad = [40.40, -3.7];

    var markerKyiv = L.marker(kyiv, { icon: markerIcon }),
        markerLnd = L.marker(lnd, { icon: markerIcon }),
        markerDC = L.marker(dc, { icon: markerIcon }),
        markerSF = L.marker(sf, { icon: markerIcon }),
        markerTrd = L.marker(trd, { icon: markerIcon }),
        markerMad = L.marker(mad, { icon: markerIcon });

    var euro = L.featureGroup([markerTrd, markerMad, markerKyiv, markerLnd]);
    var usa = L.featureGroup([markerDC, markerSF]);
    var northern = L.featureGroup([markerTrd, markerKyiv, markerLnd]);
    var southern = L.featureGroup([markerDC, markerSF, markerMad]);


    const featureOverlay = {
        'euro': euro,
        '美洲': usa,
        '北极洲': northern,
        '南极洲': southern,
    }
    return featureOverlay
}